package com.ebarlas.fractal;

import java.awt.image.BufferedImage;

import com.ebarlas.fractal.compile.ParseException;
import com.ebarlas.fractal.compile.ScanException;

/**
 * Creates fractal images according to the following algorithm:
 * 
 * Executes the recurrence relation until the halt condition
 * is satisfied.  The iteration count is updated *after* the
 * halt condition is evaluated (the first execution of the
 * halt condition is with an iteration count of 0).  When
 * the halt condition is satisfied, the color channel expressions 
 * are evaluated with the same input (if the first execution of
 * the halt condition passes, the color channels will also
 * be evaluated with an iteration count of 0).  Color channel
 * expressions are made positive and modded by 256 to ensure a 
 * valid color value [0-255].
 */
public interface FractalService {
    BufferedImage createFractalImage(Fractal fractal, int imgWidth, int imgHeight) throws ScanException, ParseException;
    void createFractalImages(FractalTransition ft, TransitionListener listener, int frames, int imgWidth, int imgHeight) throws ScanException, ParseException;
}
